package com.czk;

import com.czk.interfaces.WebServerFactory;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * 实现自定义springboot
 * 启动类
 *
 * @Author:ChenZhangKun
 * @Date: 2021/4/27 17:01
 */
@ComponentScan("com.czk") // 指定扫描路径
public class Start {
    public static void main(String[] args) throws Exception {
        // 创建容器
        AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext();
        // 注册扫描类路径
        ac.register(Start.class);
        // 开启扫描
        ac.refresh();
        // 启动服务器
        WebServerFactory server=ac.getBean(WebServerFactory.class);
        // 启动服务器
        server.crateServer();
    }
}
